﻿using BCVP.Net8.Model.ViwModels;

using SqlSugar;

namespace BCVP.Net8.IService
{
    /// <summary>
    /// 基服务接口
    /// </summary>
    public interface IBaseService<TEntity, TEntityVM> where TEntity : class, new()
    {
        ISqlSugarClient Db { get; }

        Task<List<TEntityVM>> QueryAll();

        Task<TEntityVM> Add(TEntityVM modelVM);

        Task<TEntity> Add(TEntity model);

        Task<bool> DeleteById(object id);

        Task<TEntityVM> QueryById(object objId);

        Task<bool> Update(TEntityVM modelVM);
        Task<List<TEntity>> QuerySplit(System.Linq.Expressions.Expression<Func<TEntity, bool>> whereExpression, string orderByFields = null);
        Task<List<long>> AddSplit(TEntity entity);
    }
}
